How to match queries with records that contain the query text in the middle or the end of a word.
product_reference
attribute has a numeric prefix, which may exist for internal purposes. The problem is, if a user searches for “ABCDEF” or “GHIJKL”, they won’t find anything.
Since Algolia only supports prefix search, what you need to do to is add an attribute that contains all the possible suffixes for product_reference
, as an array.
product_reference_suffixes
where we’ve stored all suffixes for the product_reference
attribute.
product_reference_suffixes
to the list of searchable attributes, to ensure the suffixes are searchable along with the original product reference.
product_reference_suffixes
after product_reference
to give it a lower priority. This way, a full match would be considered better than a partial one.